home *** CD-ROM | disk | FTP | other *** search
- ` ------------------------------------------------------------------------
- ` Morphing Stars DarkForge Snippet (15/9/2000)
- ` ------------------------------------------------------------------------
- ` Waveforms and bits of code taken from the Blitz Basic public beta
- ` just to see if it could be done. Speed is irrelevant, style is everything
-
- sync rate 0
- sync on
- hide mouse
-
- n=300
- numobjs=18
- d=1
-
- ` Make our little star graphic
-
- ink rgb(255,255,0),0 : dot 1,1
- ink rgb(255,100,100),0 : dot 1,0 : dot 1,2 : dot 0,1 : dot 2,1
- get image 1,0,0,3,3
-
- cls 0
-
- ` Draw a little logo
-
- set text font "Courier"
- i=6
- for a=50 to 255 step 50
- ink rgb(a,a,a),0
- text i,0,"DarkForge.co.uk"
- dec i
- next a
- get image 2,0,0,125,16
-
- ` Make the bitmap
-
- create bitmap 1,640,480
-
- ` Set-up the arrays
-
- dim points1(n)
- dim points2(n)
- dim points3(n)
- dim tpoint1(n)
- dim tpoint2(n)
- dim tpoint3(n)
-
- object(2,n)
-
- for t=1 to n
-
- tpoint1(t) = points1(t)
- tpoint2(t) = points2(t)
- tpoint3(t) = points3(t)
-
- next t
-
- curobj=2
-
- repeat
-
- cls 0
-
- if d<250 then inc d
-
- if cnt>375
- inc curobj
- if curobj > numobjs then curobj=1
- object(curobj,n)
- cnt=0
- endif
-
- for t=1 to n
-
- if points1(t) > tpoint1(t) then tpoint1(t) = tpoint1(t) + 1
- if points1(t) < tpoint1(t) then tpoint1(t) = tpoint1(t) - 1
- if points2(t) > tpoint2(t) then tpoint2(t) = tpoint2(t) + 1
- if points2(t) < tpoint2(t) then tpoint2(t) = tpoint2(t) - 1
- if points3(t) > tpoint3(t) then tpoint3(t) = tpoint3(t) + 1
- if points3(t) < tpoint3(t) then tpoint3(t) = tpoint3(t) - 1
-
- next t
-
- inc cnt
-
- inc vx#,0.75
- inc vy#,0.75
- inc vz#,0.75
-
- for t=1 to n
-
- x3d = tpoint1(t)
- y3d = tpoint2(t)
- z3d = tpoint3(t)
-
- ty# = (y3d * cos(vx#)) - (z3d * sin(vx#))
- tz# = (y3d * sin(vx#)) + (z3d * cos(vx#))
- tx# = (x3d * cos(vy#)) - (tz# * sin(vy#))
- tz# = (x3d * sin(vy#)) + (tz# * cos(vy#))
- ox# = tx#
- tx# = (tx# * cos(vz#)) - (ty# * sin(vz#))
- ty# = (ox# * sin(vz#)) + (ty# * cos(vz#))
-
- nx = (512*tx#) / (d - tz#) + 320
- ny = 240 - (512 * ty#) / (d - tz#)
-
- paste image 1,nx,ny
-
- next t
-
- paste image 2,0,0
- copy bitmap 1,0
- sync
-
- until spacekey()=1
-
- end
-
- function object(object,n)
-
- if object=1
-
- for t=1 to n
-
- xd# = -50
- xd# = xd# + rnd(100)
- points1(t) = xd#
- points2(t) = 0
- points3(t) = 0
-
- next t
-
- endif
-
- if object=2
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#) * 10) * (cos(t*360/n) * 10)
- y0 = (cos(xd#) * 10) * (sin(t*360/n) * 10)
- z0 = sin(xd#) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=3
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(t*360/n) * 10)
- y0 = (cos(xd#) * 10) * (sin(t*360/n) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
-
- if object=4
-
- for t=1 to n
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(xd#) * 10)
- y0 = (cos(xd#) * 10) * (sin(xd#) * 10)
- z0 = sin(xd#) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
- next t
-
- endif
-
- if object=5
-
- for t=1 to n
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(xd#) * 10)
- y0 = (cos(xd#) * 10) * (sin(xd#) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
- next t
-
- endif
-
- if object=6
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(xd#) * 10)
- y0 = (cos(t*360/n) * 10) * (sin(xd#) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
-
- if object=7
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(t*360/n)* 10) * (cos(t*360/n) * 10)
- y0 = (cos(t*360/n) * 10) * (sin(xd#) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=8
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(t*360/n)* 10) * (cos(t*360/n) * 10)
- y0 = (cos(t*360/n) * 10) * (sin(t*360/n) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=9
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(t*360/n) * 10)
- y0 = (cos(t*360/n) * 10) * (sin(t*360/n) * 10)
- z0 = sin(xd#) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=10
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(t*360/n) * 10)
- y0 = (cos(t*360/n) * 10) * (sin(xd#) * 10)
- z0 = sin(xd#) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=11
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(t*360/n)* 10) * (cos(t*360/n) * 10)
- y0 = (cos(xd#) * 10) * (sin(xd#) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=12
-
- for t=1 to n
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(t*360/n) * 10)
- y0 = (sin(xd#) * 10) * (sin(t*360/n) * 10)
- z0 = sin(xd#) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
-
- if object=13
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(xd#) * 10)
- y0 = (sin(xd#) * 10) * (sin(xd#) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=14
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(xd#) * 10)
- y0 = (sin(t*360/n) * 10) * (sin(xd#) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=15
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (sin(xd#)* 10) * (cos(xd#) * 10)
- y0 = (sin(xd#) * 10) * (sin(t*360/n) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=16
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(t*360/n)* 10) * (cos(t*360/n) * 10)
- y0 = (sin(t*360/n) * 10) * (sin(xd#) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=17
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(t*360/n) * 10)
- y0 = (sin(t*360/n) * 10) * (sin(xd#) * 10)
- z0 = cos(xd#) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- if object=18
-
- for t=1 to n
-
- xd# = -90 + rnd(180)
- x0 = (cos(xd#)* 10) * (cos(xd#) * 10)
- y0 = (cos(t*360/n) * 10) * (sin(t*360/n) * 10)
- z0 = sin(t*360/n) * 100
- points1(t) = x0
- points2(t) = y0
- points3(t) = z0
-
- next t
-
- endif
-
- endfunction
-
-
-